package com.campus.commons.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Size;

/**
 * <p>
 * 晚自习值班表
 * </p>
 *
 * @author Rin
 * @since 2020-12-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="CheckEvening对象", description="晚自习值班表")
@TableName(excludeProperty ={"className","classroomName","studentName1","studentName2","teacherName","classCount"})
public class CheckEvening implements Serializable {
    //查班的缓存集合
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "日期")
    private Date date;

    @ApiModelProperty(value = "查的班级id")
    @TableField("classId")
    private Integer classid;
    private String className;
    @ApiModelProperty(value = "查的教室id")
    @TableField("classRoomId")
    private Integer classroomid;
    private String classroomName;

    @ApiModelProperty(value = "实到人数")
    private Integer classCount;
    @ApiModelProperty(value = "实到人数")
    @TableField("factPerson")
    private Integer factperson;

    @ApiModelProperty(value = "请假人数")
    @TableField("begCount")
    private Integer begCount;
    @ApiModelProperty(value = "走读人数")
    @TableField("extern")
    private Integer extern;

    @ApiModelProperty(value = "看班老师的id")
    @TableField("teacherId")
    private Integer teacherid;
    private String teacherName;
    @ApiModelProperty(value = "晚自习组织开展情况")
    private String launch;

    @ApiModelProperty(value = "值班人员1")
    @TableField("studentId1")
    private Integer studentid1;
    private String studentName1;
    @ApiModelProperty(value = "看班人员2")
    @TableField("studentId2")
    private Integer studentid2;
    private String studentName2;

    @ApiModelProperty(value = "备注信息")
    private String remark;


    public void setClassid(Integer classid) {
        this.classid = classid;
        this.className = Class.classes.get(classid).getClassname();
        this.classCount= Class.classes.get(classid).getClassCount();
        Class aClass = Class.classes.get(classid);
        this.className = aClass.getClassname();

    }
        public void setClassroomid(Integer classroomid) {
        this.classroomid = classroomid;
        this.classroomName = ClassRoom.classrooms.get(classroomid);
    }

    public void setTeacherid(Integer teacherid) {
        this.teacherid = teacherid;
        this.teacherName = Teacher.teachers.get(teacherid).getTeachername();
    }

    public void setStudentid1(Integer studentid1) {
        this.studentid1 = studentid1;
        this.studentName1 = Student.students.get(studentid1).getStuname();
    }

    public void setStudentid2(Integer studentid2) {
        this.studentid2 = studentid2;
        this.studentName2 = Student.students.get(studentid2).getStuname();
    }

    @ApiModelProperty(value = "标红 0未标红 1标红")
    @TableField("isRed")
    @Range(min = 0,max = 1,message = "参数值范围有误；要求该值最小0最大为1")
    private Integer isred;

    @ApiModelProperty(value = "图片")
    private String image;


}
